home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / game / patch / WHDIGamesH-M.lzh / games / JimmyWhitesWhirlwindSnooker.lha / JWWSInstall / Install_JWWS < prev    next >
Text File  |  1998-07-09  |  7KB  |  343 lines

  1. ;
  2. ;$VER: Jimmy White's Whirlwind Snooker HD Installer script v1.02 (c) 1998 John Girvin
  3. ;
  4. ;------------------------------------------------------------------------------------
  5. ; Make game data
  6.  
  7. (procedure S_InstallGame
  8. (
  9.     ;
  10.     ; Get game disk inserted
  11.     ;
  12.     (message
  13.         (cat
  14.             "\n\n\nPlease insert your game disk in drive DF0:\n\n"
  15.             "Click 'Proceed' when ready."
  16.         )
  17.     )
  18.  
  19.     ;
  20.     ; Copy extractor slave to destination
  21.     ;
  22.     (copyfiles
  23.         (prompt "Copying data extractor slave")
  24.         (help @copyfiles-help)
  25.         (source "JWWSMakeDat")
  26.         (dest #TDESTDIR)
  27.         (nogauge)
  28.         (noposition)
  29.         (optional fail force)
  30.     )
  31.  
  32.     ;
  33.     ; Call the data extractor
  34.     ;
  35.     (message    "\n\n*** WARNING ***\n\n"
  36.                 "The next stage of the installation process requires that"
  37.                 " multitasking be disabled temporarily while a data file"
  38.                 " is being read and decrunched. This may take up to two"
  39.                 " minutes depending on the speed of your Amiga.\n\n"
  40.                 " Please ensure that all critical activity (eg: disk or"
  41.                 " network access) has finished before clicking 'Proceed'.\n\n"
  42.                 "Click 'Proceed' when ready."
  43.     )
  44.  
  45.     (working
  46.         (cat "Creating game data file in '" #TDATDIR "'\n\n"
  47.                 "*** Multitasking is disabled - DON`T PANIC! ***"
  48.         )
  49.     )
  50.  
  51.     (set #TOLDEXEDIR @execute-dir)
  52.     (set @execute-dir #TDESTDIR)
  53.     (run
  54.         (cat
  55.             (tackon #TDESTDIR
  56.                     "WHDLoad SLAVE=JWWSMakeDat NOVBRMOVE NOCACHE NOAUTOVEC NOTRAPHANDLER"
  57.             )
  58.         )
  59.     )
  60.     (set @execute-dir #TOLDEXEDIR)
  61.  
  62.     ;
  63.     ; Delete the data extractor
  64.     ;
  65.     (delete
  66.         (tackon #TDESTDIR "JWWSMakeDat")
  67.         (prompt "Deleting data extractor slave")
  68.         (optional fail force)
  69.     )
  70.  
  71.     ;
  72.     ; Did the data extractor work?
  73.     ; Check that the file was created and is the correct size
  74.     ;
  75.  
  76.     (set #TMAINSIZE (getsize (tackon #TDATDIR "Main")))
  77.  
  78.     (if (<>    #TMAINSIZE 330160)
  79.         (if (<>    #TMAINSIZE 330192)
  80.             (if (<>    #TMAINSIZE 330888)
  81.                 (abort "Could not create data file !")
  82.                 (set #TSLAVENAME "v3")
  83.             )
  84.             (set #TSLAVENAME "v2")
  85.         )
  86.         (set #TSLAVENAME "v1")
  87.     )
  88.     (set #TSLAVENAME (cat #TSLAVENAME ".gpch"))
  89.  
  90.     (message "\n\nData file successfuly created!"
  91.              "\n\nMultitasking is re-enabled."
  92.     )
  93. ))
  94.  
  95. ;------------------------------------------------------------------------------------
  96. ; Make HD loader slave
  97.  
  98. (procedure S_InstallSlave
  99. (
  100.     ;
  101.     ; Create slave from base file and patch
  102.     ;
  103.     (working "Creating slave program")
  104.     (set #TRCODE
  105.         (run
  106.             (cat "GPatch JWWSHD_base "
  107.                      #TSLAVENAME " "
  108.                     (tackon #TDESTDIR "JW_Snooker")
  109.             )
  110.         )
  111.     )
  112.  
  113.     (if (<> #TRCODE 0)
  114.         (abort
  115.             (cat "Slave generation failed error " #TRCODE)
  116.         )
  117.     )
  118.  
  119.  
  120.     ;    
  121.     ; Copy slave icon and set tooltypes
  122.     ;
  123.     (copyfiles
  124.         (prompt "Copying slave program icon")
  125.         (help @copyfiles-help)
  126.         (source "Slave.inf")
  127.         (newname "JW_Snooker.info")
  128.         (dest #TDESTDIR)
  129.         (nogauge)
  130.         (optional fail force)
  131.     )
  132.  
  133.     (tooltype
  134.         (prompt "Setting HD loader slave icon tooltypes")
  135.         (dest (tackon #TDESTDIR "JW_Snooker"))
  136.         (setdefaulttool "WHDLoad")
  137.         (settooltype "SLAVE" "JW_Snooker")
  138.         (settooltype "NOVBRMOVE" "")
  139.         (settooltype "NOCACHE" "")
  140.         (settooltype "PRELOAD" "")
  141.     )
  142. ))
  143.  
  144. ;------------------------------------------------------------------------------------
  145. ; Make save data
  146.  
  147. (procedure S_InstallSave
  148. (
  149.     ;
  150.     ; Copy save extractor to destination
  151.     ; Do it even if user is installing default saves
  152.     ; since it will be required later if they want to
  153.     ; install a save disk with the other script
  154.     ;
  155.     (copyfiles
  156.         (prompt "Copying save data extractor program")
  157.         (help @copyfiles-help)
  158.         (source "JWWSMakeSave")
  159.         (dest #TDATDIR)
  160.         (nogauge)
  161.         (noposition)
  162.         (optional fail force)
  163.     )
  164.  
  165.     ;
  166.     ; Install actual saves or defaults?
  167.     ;
  168.     (if (= 1
  169.             (askbool
  170.                 (prompt "Do you want to install any existing saved games and scores?")
  171.                 (help @askchoice-help)
  172.                 (choices "Yes" "No")
  173.                 (default 0)
  174.             )
  175.         )
  176.         (    ; Install from save disk
  177.  
  178.             ;
  179.             ; Get save disk inserted
  180.             ;
  181.             (message
  182.                 (cat "\n\n\nPlease insert your save disk in drive DF0:\n\n"
  183.                      "Click 'Proceed' when ready."
  184.                 )
  185.             )
  186.  
  187.             ;
  188.             ; Call the save extractor
  189.             ;
  190.             (set #TOLDEXEDIR @execute-dir)
  191.             (set @execute-dir #TDATDIR)
  192.             (run (cat(tackon #TDATDIR "JWWSMakeSave 0")))
  193.             (set @execute-dir #TOLDEXEDIR)
  194.  
  195.             ;
  196.             ; Did the save install work?
  197.             ; Check that the files were created
  198.             ;
  199.             (if (<>    (getsize (tackon #TDATDIR "SaveDat.6B4")) 5632)
  200.                 (abort "Could not create save data file 1 !")
  201.             )
  202.  
  203.             (if (<>    (getsize (tackon #TDATDIR "SaveDat.6CA")) 5632)
  204.                 (abort "Could not create save data file 2 !")
  205.             )
  206.  
  207.             (message "\n\n\n\nSaved games and scores successfuly installed!")
  208.         )
  209.         (    ;Install empty save data files
  210.  
  211.             (copyfiles
  212.                 (prompt "Copying empty saved game buffer")
  213.                 (help @copyfiles-help)
  214.                 (source "SaveDat.6B4")
  215.                 (dest #TDATDIR)
  216.                 (nogauge)
  217.                 (optional fail force)
  218.             )
  219.  
  220.             (copyfiles
  221.                 (prompt "Copying empty saved game buffer")
  222.                 (help @copyfiles-help)
  223.                 (source "SaveDat.6CA")
  224.                 (dest #TDATDIR)
  225.                 (nogauge)
  226.                 (optional fail force)
  227.             )
  228.         )
  229.     )
  230. ))
  231.  
  232. ;------------------------------------------------------------------------------------
  233. (welcome "Welcome to the Jimmy White's Whirlwind Snooker HD Installer")
  234. (set @app-name (cat "Jimmy White's Whirlwind Snooker"))
  235. (set #TROOTDIR "RAM:")
  236. (set #TDESTDIR "")
  237. (set #TDATDIR "")
  238. (set #TMAINSIZE 0)
  239. (set #TSLAVENAME "")
  240.  
  241. (if    (<> @user-level 2)
  242.     (abort "You must select 'Expert' user level")
  243. )
  244.  
  245. (if    (< @installer-version 2818051)
  246.     (abort "This package requires at least version 43.3 of the Installer program")
  247. )
  248.  
  249. (message "\n\nWelcome to the Jimmy White's Whirlwind Snooker HD Installer\n"
  250.          "(c) 1998 John Girvin\n\n"
  251.          "Please read the documentation thoroughly before"
  252.          " attempting to use this installer!\n\n"
  253.          "This is version 1.02\n\n"
  254.          "Click 'Proceed' to begin."
  255. )
  256.  
  257. ;
  258. ; Get directory to install JWWS in
  259. ;
  260. (set #TROOTDIR
  261.     (askdir
  262.         (prompt "Where would you like Jimmy White's Whirlwind Snooker installed?\n"
  263.                 "(a new drawer called 'JW_Snooker' will be created here)"
  264.         )
  265.         (help @askdir-help)
  266.         (default #TROOTDIR)
  267.     )
  268. )
  269. (set #TDESTDIR (tackon #TROOTDIR "JW_Snooker/"))
  270. (set #TDATDIR  (tackon #TDESTDIR "data/"))
  271. (set @default-dest #TDESTDIR)
  272.  
  273. ;
  274. ; Copy disk drawer icon
  275. ;
  276. (copyfiles
  277.     (prompt "Copying HD drawer icon")
  278.     (help @copyfiles-help)
  279.     (source "Drawer.inf")
  280.     (newname "JW_Snooker.info")
  281.     (dest #TROOTDIR)
  282.     (nogauge)
  283.     (optional fail force)
  284. )
  285.  
  286. ;
  287. ; Create the installation directories
  288. ;
  289. (makedir #TDESTDIR
  290.     (prompt "The directory '" #TDESTDIR "' will now be created")
  291.     (help @makedir-help)
  292.     (infos)
  293.     (confirm)
  294. )
  295.  
  296. (makedir #TDATDIR
  297.     (prompt "The directory '" #TDATDIR "' will now be created")
  298.     (help @makedir-help)
  299. )
  300.  
  301. ;
  302. ; Copy WHDload
  303. ; Copy now because its required by the data extractor slave
  304. ;
  305. (copyfiles
  306.     (prompt "Copying WHDLoad program")
  307.     (help @copyfiles-help)
  308.     (source "WHDLoad")
  309.     (dest #TDESTDIR)
  310.     (nogauge)
  311.     (noposition)
  312.     (optional fail force)
  313. )
  314.  
  315. ;
  316. ; Install the game data, slave and save data
  317. ;
  318. (S_InstallGame)
  319. (S_InstallSlave)
  320. (S_InstallSave)
  321.  
  322. ;
  323. ; Copy savegame installer script and icon
  324. ;
  325. (copyfiles
  326.     (prompt "Copying savegame installer script")
  327.     (help @copyfiles-help)
  328.     (source "Install_JWWS_Save")
  329.     (dest #TDESTDIR)
  330.     (nogauge)
  331.     (optional fail force)
  332. )
  333.  
  334. (copyfiles
  335.     (prompt "Copying savegame installer script icon")
  336.     (help @copyfiles-help)
  337.     (source "InstallSave.inf")
  338.     (newname "Install_JWWS_Save.info")
  339.     (dest #TDESTDIR)
  340.     (nogauge)
  341.     (optional fail force)
  342. )
  343.